//
//  YSTopicListHeadeView.m
//  Yueshi
//
//  Created by yueshi－mac1 on 15/12/8.
//  Copyright © 2015年 悦食中国. All rights reserved.
//

#import "YSTopicListHeadeView.h"

@interface YSTopicListHeadeView()
@property (weak, nonatomic) IBOutlet UIView *groupInfoView;
@property (weak, nonatomic) IBOutlet UIImageView *avatarView;
@property (weak, nonatomic) IBOutlet UILabel *groupLeader;

@end

@implementation YSTopicListHeadeView

+ (instancetype)headerView{
    return [[[NSBundle mainBundle] loadNibNamed:@"YSTopicListHeadeView" owner:nil options:nil] lastObject];
}

- (void)setInterestGroup:(YSInterestGroup *)interestGroup{
    _interestGroup = interestGroup;
    [_avatarView setImageURLStr:interestGroup.userImg];
    [_groupLeader setText:[NSString stringWithFormat:@"组长：%@",interestGroup.groupLeader]];
    
    UITapGestureRecognizer  *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(handleTapGesture:)];
    [_groupInfoView addGestureRecognizer:tap];
}

- (void)handleTapGesture:(UITapGestureRecognizer *)gestureRecognizer{
    if(self.toGroupIntroduction){
        self.toGroupIntroduction();
    }
}


/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
